package work.xiaohong.order.feign;

import work.xiaohong.model.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import work.xiaohong.order.fallback.AccountFallback;
import work.xiaohong.order.to.AccountTbl;

/**
 * @author xiaohong
 * @version 1.0
 * @date 2021/9/17 0017 19:17
 */
@FeignClient(name = "xiaohong-account",contextId = "accountTbl",fallback = AccountFallback.class)
public interface AccountFeign {

    @GetMapping("/account/{id}")
    Result<AccountTbl> findById(@PathVariable(value="id") Integer id);

    @PutMapping("/account")
    Result updateById(@RequestBody AccountTbl accountTbl);

}
